package com.example.elm_server_api.domain;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 订单配送表
 * @TableName deliver_task
 */
@Data
public class DeliverTask implements Serializable {
    /**
     * 主键
     */
    private Integer id;

    /**
     * 订单ID
     */
    private String orderId;

    /**
     * 送餐员ID
     */
    private Integer deliverId;

    /**
     * 配送费
     */
    private Integer sendCost;

    /**
     * 加入时间
     */
    private Date addTime;

    /**
     * 状态
     */
    private Integer status;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeliverTask other = (DeliverTask) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getDeliverId() == null ? other.getDeliverId() == null : this.getDeliverId().equals(other.getDeliverId()))
            && (this.getSendCost() == null ? other.getSendCost() == null : this.getSendCost().equals(other.getSendCost()))
            && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getDeliverId() == null) ? 0 : getDeliverId().hashCode());
        result = prime * result + ((getSendCost() == null) ? 0 : getSendCost().hashCode());
        result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderId=").append(orderId);
        sb.append(", deliverId=").append(deliverId);
        sb.append(", sendCost=").append(sendCost);
        sb.append(", addTime=").append(addTime);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}